1. Field of the Invention
The present invention relates to a microcomputer containing an EEPROM (Electrically Erasable Programmable ROM) as a flash memory.
2. Description of the Related Art
A 1-chip microcomputer has a programmable memory (non-volatile memory) integrated over a single chip. A mask ROM, EPROM, EEPROM or the like is used as the programmable memory.
(1) Mask ROM
A microcomputer containing a mask ROM has the advantage that production efficiency can be improved and chip area reduced by manufacturing a plurality of masks in one batch. However, in the event of reprogramming, the plurality of masks must be re-manufactured, resulting in the disadvantages that considerable manufacturing time is required and the reprogramming request cannot be dealt with swiftly.
(2) EPROM
Use of an EPROM offers the advantage that a reprogramming request can be responded to swiftly by ultravioletly erasing the present data prior to writing in new data. However, since all present data are thereby ultravioletly erased, there is the drawback that data which did not require erasure must be rewritten.
(3) EEPROM
Use of an EEPROM offers the advantage that a reprogramming request can be responded to swiftly by electrically erasing the present data prior to writing in new data. In addition, since present data can be partially erased, data which do not need to be erased can be retained.
Recent 1-chip microcomputers utilize the advantages of all non-volatile memories and contain an EEPROM and a mask ROM. The EEPROM is used as a programmable memory for controlling the operation of the 1-chip microcomputer; the mask ROM is used as a programmable memory for rewriting EEPROM data. As a result, the 1-chip microcomputer can rewrite EEPROM data by itself with an improved level of versatility.
Let us consider a case in which the 1-chip microcomputer is designed to switch the EEPROM to write mode in compliance with the state of a flag. During the period between switch-on of the 1-chip microcomputer and power stabilization the flag inclines neither to "0" not to "1" and is therefore in an indeterminate state. However, when the flag value has accidentally been set to the same value as the logic value for switching the EEPROM to write mode, the EEPROM will switch to write mode even though the 1-chip microcomputer is not yet stable, with the resulting problem that the EEPROM writes incorrect data.